Ext.define('HRMS.store.user.Account', {
    extend: 'Ext.data.Store',
    alias: 'widget.contactstore',
    
    autoLoad: true,
    model: 'HRMS.model.user.Account',
    
    proxy: {
		type: 'ajax',
		api: {
			read: 'account/view.json',
			create: 'account/create',
			update: 'account/update',
			destroy: 'account/delete'
		},
		reader:{
			type: 'json',
			root: 'data',
			successProperty: 'success'
		},
		writer: {
			type: 'json',
			writeAllFields: true,
		},
		listeners: {
			exception: function(proxy, response, operation){
				Ext.MessageBox.show({
					title: 'REMOTE EXCEPTION',
					msg: operation.getError(),
					icon: Ext.MessageBox.ERROR,
					buttons: Ext.Msg.OK
				});
			}
		}
	}
});